﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DomainApi.Controllers
{
    public class MySqlConnect
    {
        public MySqlConnection connection = null;//连接对象
        public MySqlCommand command = null;//语句执行对象
        public MySqlDataReader reader = null;//语句执行结果数据对象

        public void Load()
        {
            MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder();
            //数据库连接时的用户名
            builder.UserID = "fch156235";
            //数据库连接时的密码
            builder.Password = "60a71f0d26e03064";
            //数据库连接时的服务器地址
            builder.Server = "mysql.sqlpub.com";
            //要连接的数据库
            builder.Database = "domaindb";
            //定义与数据连接的链接
            connection = new MySqlConnection(builder.ConnectionString);
            connection.Open();




        }
    }

}
